#include "aicommandsendfax.h"

namespace IAlib
{

AiCommandSendFax::AiCommandSendFax()
{
    AiCommand::setType(COMMAND_SEND_FAX);
}

QByteArray AiCommandSendFax::toByteArray() const
{
    QByteArray byte_array;
    QDataStream data(&byte_array, QIODevice::WriteOnly);

    data<<getMode();
    data<<getNumOrigine();
    data<<getNumTarget();
    data<<getFax();

    return byte_array;
}

void AiCommandSendFax::fromByteArray(QByteArray &byte_array)
{
    QDataStream data(&byte_array, QIODevice::ReadOnly);
    int i_temp;
    QString s_temp;
    data>>i_temp;
    setMode((CommandMode)i_temp);
    data>>s_temp;
    setNumOrigine(s_temp);
    data>>s_temp;
    setNumTarget(s_temp);
    data>>m_fax;
}

}
